package com.ews.onlineexchange.model.bulletinRequirement;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.validation.constraints.Min;

import com.ews.onlineexchange.model.Attachment;
import com.ews.onlineexchange.model.DataEntity;
import com.ews.onlineexchange.model.Image;
import com.ews.onlineexchange.model.RequirementDefination;

/**公共要求
 * @author Administrator
 *
 */
@Entity
public class Requirement extends DataEntity {

	/**
	 * 
	 */
	private static final long		serialVersionUID	= 1L;
	private List<Attachment>		attachments			= new ArrayList<>();
	private List<Image>				images				= new ArrayList<>();
	private RequirementDefination	requirementDefination;
	private BigDecimal				score;
	
	@ManyToOne
	public RequirementDefination getRequirementDefination() {
		return requirementDefination;
	}

	public void setRequirementDefination(RequirementDefination requirementDefination) {
		this.requirementDefination = requirementDefination;
	}

	@OneToMany(cascade = CascadeType.ALL)
	public List<Attachment> getAttachments() {
		return attachments;
	}

	public void setAttachments(List<Attachment> attachments) {
		this.attachments = attachments;
	}

	@OneToMany(cascade = CascadeType.ALL)
	public List<Image> getImages() {
		return images;
	}

	public void setImages(List<Image> images) {
		this.images = images;
	}

	@Min(0L)
	public BigDecimal getScore() {
		return score;
	}

	public void setScore( BigDecimal score ) {
		this.score = score;
	}	
	
}
